﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace DotNetMVC.OA.IBLL
{
    public interface IBaseService<T> where T:class,new ()
    {
        //crue
        #region 查询
        IQueryable<T> GetEntities(Expression<Func<T, bool>> whereLambda);

        IQueryable<T> GetPageEntities<S>(
           int pageSize, int pageIndex, out int total,
           Expression<Func<T, bool>> whereLambda,
           Expression<Func<T, S>> orderByLambda,
           bool isAsc
           );
        #endregion

        #region cud
        T Add(T Entity);
        bool Update(T Entity);
        bool Delete(T Entity);
        bool Delete(long id, bool isBatch = false);
        int Delete(List<long> ids);
        #endregion
    }
}
